import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.prototype.$author = '妄揽明月'
// Vue.use(VueRouter)
const author = Vue.prototype.$author
const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Home/index.vue'),
    meta: {
      title: author + '-首页'
    }
  },
  {
    path: '/main',
    name: 'main',
    component: () => import('../views/Main/index.vue'),
    meta: {
      title: author + '-主页',
      keepAlive: true
    }
  },
  {
    path: '/writeBlog',
    name: 'writeBlog',
    component: () => import('../views/Personal/WriteBlog.vue'),
    meta: {
      title: author + '-写博客'
    }
  },
  {
    path: '/article/:id',
    name: 'article',
    component: () => import('../views/Article/ActiclePage.vue'),
    props: true
  },
  {
    path: '/notFound',
    name: 'notFound',
    component: () => import('../views/NotFound.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
